package com.studio5704website.infrastructure.service;


import com.studio5704website.core.security.UrlPermission;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * @author Gao
 */
@Repository
public class RedisUrlPermission implements UrlPermission {

    private RedisUtil redisUtil;

    @Autowired
    public RedisUrlPermission(RedisUtil redisUtil) {
        this.redisUtil = redisUtil;
    }

    @Override
    public Map<String, String> getUrlPermission() {
        Map<String, String> urlPermission = (Map<String, String>) redisUtil.get("urlPermission");
        return urlPermission;
    }
}
